# Maintainer: Caleb Maclennan <caleb@alerque.com>
# Contributor: int <int [ate] arcor [dot] de>

pkgname=perl-b-debug-cpan
_pkgname=B-Debug
pkgver=1.26
pkgrel=3
pkgdesc='Perl/CPAN Module B::Debug: Walk Perl syntax tree, printing debug info about ops'
arch=(any)
license=(PerlArtistic GPL)
options=(!emptydirs)
depends=(perl)
url="https://metacpan.org/release/$_pkgname"
_archive="$_pkgname-$pkgver"
source=("http://search.cpan.org/CPAN/authors/id/R/RU/RURBAN/$_archive.tar.gz")
sha256sums=('8d6d3f5134f0ddd8dde68e6581f5b30b73b7db40fd28d076e4f6e5386f570d3a')

build() {
	cd "$_archive"
	unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
	export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL=--skipdeps
	/usr/bin/perl Makefile.PL
	make
}

check() {
	cd "$_archive"
	unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
	export PERL_MM_USE_DEFAULT=1
	make test
}

package() {
	cd "$_archive"
	unset PERL5LIB PERL_MM_OPT PERL_LOCAL_LIB_ROOT
	make install INSTALLDIRS=vendor DESTDIR="$pkgdir"
}
